varying vec3 texCoordinate;
uniform sampler2D b1;
uniform sampler2D b2;
uniform sampler2D b3;
uniform sampler2D b4;
uniform sampler2D frame;
uniform float exposure;
uniform float threshold;

void main (void)
{
  vec4 colorTemp = texture2D(frame, texCoordinate.xy);
  vec4 color = exposure*colorTemp;
  
    //below is S-curve implementation on the following form:
    // n=0.7;
    // sigma=20;
    //Q=(I.^n)./(I.^n+sigma^n);

  float temp  = (pow(exposure, 0.7))/(pow(exposure, 0.7)+pow(20.0, 0.7));
  color *= temp;
    
	gl_FragColor = color;
}
